﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PowerVSharp.Core.Utils
{
    public class DynamicHelper
    {
        public static object[] DynamicToArray(dynamic input)
        {
            if (input is Array)
            {
                return (object[])input;
            }
            else
            {
                return new object[1] { input };
            }
        }

        public static string[] DynamicToStringArray(dynamic input)
        {
            var array = (object[])DynamicToArray(input);
            return array.Select(i => i.ToString()).ToArray() ;
        }
    }
}
